# 作者：YongxiangLi
# 2025年03月06日10时41分47秒
# liyongxiang2024@163.com
def use_except():
    """
    练习简单的异常捕获
    :return:
    """
    while True:
        try:
            num = int(input("请输入一个数字："))
            print(num)
            break
        except:
            print("请输入数字")


# use_except()
try:
    num = int(input("请输入整数："))
    result = 8 / num
    print(result)
except ValueError:
    print("请输入正确的整数")
# except ZeroDivisionError:
#     print("除 0 错误")
except Exception as e:
    print(e)
    print(type(e))
